// Unified device communication interface
import 'dart:async';

class DeviceStatus {
  final bool connected;
  final Map<String, dynamic> snapshot;
  const DeviceStatus({required this.connected, this.snapshot = const {}});
}

abstract class IDeviceService {
  Future<void> startDiscovery();
  Stream<List<DiscoveredDevice>> get discovery$;
  Future<void> connect(String deviceId);
  Future<void> disconnect();
  Future<void> sendCommand(String code, dynamic value);
  Stream<DeviceStatus> get status$;
}

class DiscoveredDevice {
  final String id;
  final String name;
  final int? rssi;
  const DiscoveredDevice({required this.id, required this.name, this.rssi});
}
